package com.yun.service.impl;

import java.util.List;

import com.yun.bean.YunPlayer;
import com.yun.dao.YunDAO;
import com.yun.dao.impl.YunDAOImpl;
import com.yun.service.PlayerService;

public class PlayerServiceImpl implements PlayerService {
	private YunDAO yunDAO = new YunDAOImpl();
	
	@Override
	public List<YunPlayer> listAll() {
		return yunDAO.selectAll();
	}

	@Override
	public void addPlayer(YunPlayer yunPlayer) {
		yunDAO.insert(yunPlayer);
	}

	@Override
	public Boolean removeById(String p_id) {
		return yunDAO.deleteById(p_id);
	}

	@Override
	public YunPlayer selectById(String id) {
		return yunDAO.selectById(id);
	}

	@Override
	public List<YunPlayer> listAllByPage(int offset,int limit) {
		return yunDAO.selectAllByPage(offset, limit);
	}

	@Override
	public Boolean updPlayer(YunPlayer yunPlayer) {
		return yunDAO.update(yunPlayer);
	}

	@Override
	public int getTotal() {
		return yunDAO.selectCount();
	}

	@Override
	public int removeAll(List<String> pidsList) {
		return yunDAO.deleteAll(pidsList);
	}

}
